package com.wt.chat.utils;

/**
 * @description
 * @author: wangtao
 * @date:15:07 2019/11/8
 * @email:taow02@jumei.com
 */
public class Keys {

	public final static String LOGIN_NONCE_STR_KEY = "LOGIN_NONCE_STR";

	public final static String LOGIN_COOKIE_KEY = "token";

	public static final String DIALOG_QUEUE = "DIALOG_QUEUE:";

	public static final String KEFU_ONLINE_HASH_KEY = "KEFU_OLINE";

	/**
	 * 客服有新消息的dialog列表，用户发送消息后更新dialog列表
	 * @param kefuId
	 * @return
	 */
	public static String getNewMessageDialogsKey(TAG tag, String receiverId) {
		return "NEW_MESSAGE_DIALOGS_KEY:" + tag.getName() + receiverId;
	}

	/**
	 * dialog key,存放dialog所有消息
	 * @param dialogId
	 * @return
	 */
	public static String getDialogMessageRedisKey(String dialogId) {
		return "DIALOG_MESSAGE_REDIS_KEY:" + dialogId;
	}

	public static String getGroupIdKey(String groupId) {
		return "Group:" + groupId;
	}

	/**
	 * 会话排队队列
	 * @param group
	 * @return
	 */
	public static String getDialogQueueByGroup(String group) {
		return DIALOG_QUEUE + group;
	}


	public enum TAG {
		/**
		 * 消息发送方标识
		 */
		KEFU("kefu"), USER("user");

		private String name;

		TAG(String name) {
			this.name = name;
		}

		public String getName() {
			return name;
		}
	}
}
